<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      eventData: {
        eventName: "",
        isAnonymous: false,
        reporterName: "",
        contactNumber: "",
        reportTime: "",
        location: "",
        photos: [],
        description: "",
        eventType: "",
      },
    };
  },
  filters: {},
  components: {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs.eventForm.validate((valid) => {
        if (valid) {
          // 在这里执行提交表单的操作
          console.log(this.eventData);
        }
      });
    },
    resetForm() {
      this.$refs.eventForm.resetFields();
    },
    handleUploadSuccess(response, file, fileList) {
      // 处理文件上传成功的操作
    },
    handleUploadRemove(file, fileList) {
      // 处理文件移除的操作
    },
  },
  beforeCreate: function () {
    let arr = [
      require("@/assets/images/partyBuildingBg.jpg"),
      require("@/assets/images/smartGridBg.jpg"),
      require("@/assets/images/guideBg.jpg"),
      require("@/assets/images/bigDataBg.jpg"),
    ];

    let img = new Image();
    img.src = require("@/assets/images/partyBuildingBg.jpg");
    img.onload = function () {};

    let img1 = new Image();
    img1.src = require("@/assets/images/smartGridBg.jpg");
    img1.onload = function () {};

    let img2 = new Image();
    img2.src = require("@/assets/images/guideBg.jpg");
    img2.onload = function () {};
    let img3 = new Image();
    img3.src = require("@/assets/images/bigDataBg.jpg");
    img3.onload = function () {};
  },
  beforeDestroy(){
    // 删除登录信息
    sessionStorage.clear();
  }
};
</script>

<style scoped>
#app {
  width: 100%;
  height: 100%;
}
</style>
